import Vue from "vue";
import Router from "vue-router";

import Layout from "@/layouts/layout";
import Login from "@/views/login";
import NotFound from "@/views/errorPage/404.vue";
import Forbidden from "@/views/errorPage/403.vue";

Vue.use(Router);

const routes = [
  {
    path: "/login",
    name: "login",
    component: Login
  }
];

export const DynamicRoutes = [
  {
    path: "",
    name: "layout",
    component: Layout,
    // redirect: "menuConfig",
    meta: {
      requiresAuth: true,
      name: "首页"
    },
    children: []
  },
  {
    path: "/403",
    component: Forbidden
  },
  {
    path: "*",
    component: NotFound
  }
];

const router = new Router({
  mode: "history",
  base: process.env.BASE_URL,
  routes
});

export default router;
